import ajax from "./ajax";
// 1.home页面请求 王
export const swiperImg = () => {
  return ajax({ url: "/swiperImg", method: "get" });
};
export const cateGoryList = () => {
  return ajax.get("/cateGoryList");
};
// 2.确认订单页面 黄
// 请求订单
export const reqOrder = () => {
  return ajax.get('/order')
};

// 请求收货地址的接口函数
export const reqAddress = () => {
  return ajax.get('/address')
}

// 默认的收货地址
export const reqDefaultAdd = (flag) => {
  return ajax.get(`/address?isDefault=${flag}`)
}
// 3.购物车页面 朱明朗
// 获取我的订单列表
export const reqMyShopCart = () => ajax({ url: "/shopCart", method: "get" });

// 获取推荐物品
export const reqMyRecommend = () => ajax({ url: "/recommend", method: "get" });

// 删除单个商品
export const reqDelete = (id) =>
  ajax({ url: `/shopCart/${id}`, method: "delete" });

// 修改单个选项
export const reqChange = (data) =>
  ajax({ url: `/shopCart/${data.id}`, method: "patch", data });
// 4.搜索页面 朱皖蓉
export const reqGoodsList = () =>
  ajax({
    url: "/item",
    method: "get",
  });
export const reqPagination = (page, limit) =>
  ajax({
    url: `/item?_page=${page}&_limit=${limit}`,
    method: "get",
  });
// 5.详情页面 李
export const reqGoodsDetailInfo=()=>ajax({url:"/item",method:'get'})
